#include "Interpolation.h"

#define PI acos(-1)

class Function2 : public Function
{
public:
    double operator()(double x)
    {
        return 1 / (25 * x * x + 1);
    }
};

int main()
{
    vector<double> x, y, z;
    Function2 f;
    for (int i = 5; i <= 20; i += 5)
    {
        for (int j = 1; j <= i; j++)
        {
            double zw = cos((j - 0.5) * PI / i);
            x.push_back(zw);
            y.push_back(f(zw));
        }
        Newton np(i - 1, x, y);
        np.Newtonpolation();
        np.printpolynomial();
        x.clear();
        y.clear();
        z.clear();
    }
}